package com.kj.platformlogistics.my.activity;

import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.ImageView;

import com.bumptech.glide.Glide;
import com.kj.platformlogistics.R;
import com.kj.platformlogistics.base.BaseActivity;
import com.kj.platformlogistics.common.UserData;

public class ActivityCarInfo extends BaseActivity implements View.OnClickListener {
    private ImageView ivCarPicture,ivCarPlatePicture,ivCarDriverPlate,ivDriverOperation;
    private ImageView ivImg1,ivImg2,ivImg3,ivImg4;

    public static void actionStart(Context context) {
        Intent intent = new Intent(context, ActivityCarInfo.class);
        context.startActivity(intent);
    }

    @Override
    public void onClick(View v) {

    }

    @Override
    protected void init(Bundle savedInstanceState) {
        setAndroidNativeLightStatusBar(true);
    }

    @Override
    protected int setLayoutResourceID() {
        return R.layout.activity_car_info;
    }

    @Override
    protected void initView() {
        setTitleText("身份认证");
        ivCarPicture=findViewById(R.id.ivCarPicture);
        ivImg1=findViewById(R.id.ivImg1);
        ivImg2=findViewById(R.id.ivImg2);
        ivImg3=findViewById(R.id.ivImg3);
        ivImg4=findViewById(R.id.ivImg4);
        ivCarPlatePicture=findViewById(R.id.ivCarPlatePicture);
        ivCarDriverPlate=findViewById(R.id.ivCarDriverPlate);
        ivDriverOperation=findViewById(R.id.ivDriverOperation);

        if (UserData.create(ActivityCarInfo.this).get(UserData.driverCarPhoto)!=null&&
                !UserData.create(ActivityCarInfo.this).get(UserData.driverCarPhoto).equals("")){
            Glide.with(ActivityCarInfo.this)
                    .load(UserData.create(ActivityCarInfo.this).get(UserData.driverCarPhoto))
                    .placeholder(R.mipmap.default_image)
                    .into(ivCarPicture);
            ivImg1.setImageResource(R.mipmap.icon_address_selected);
        }else {
            ivImg1.setImageResource(R.mipmap.icon_address_unselected);
        }



        if (UserData.create(ActivityCarInfo.this).get(UserData.driverPlate)!=null&&
                !UserData.create(ActivityCarInfo.this).get(UserData.driverPlate).equals("")){
            Glide.with(ActivityCarInfo.this)
                    .load(UserData.create(ActivityCarInfo.this).get(UserData.driverCarPhoto))
                    .placeholder(R.mipmap.default_image)
                    .into(ivCarPlatePicture);
            ivImg2.setImageResource(R.mipmap.icon_address_selected);
        }else {
            ivImg2.setImageResource(R.mipmap.icon_address_unselected);
        }

        if (UserData.create(ActivityCarInfo.this).get(UserData.driverVehicle)!=null&&
                !UserData.create(ActivityCarInfo.this).get(UserData.driverVehicle).equals("")){
            Glide.with(ActivityCarInfo.this)
                    .load(UserData.create(ActivityCarInfo.this).get(UserData.driverVehicle))
                    .placeholder(R.mipmap.default_image)
                    .into(ivCarDriverPlate);
            ivImg3.setImageResource(R.mipmap.icon_address_selected);
        }else {
            ivImg3.setImageResource(R.mipmap.icon_address_unselected);
        }

        if (UserData.create(ActivityCarInfo.this).get(UserData.driverOperation)!=null&&
                !UserData.create(ActivityCarInfo.this).get(UserData.driverOperation).equals("")){
            Glide.with(ActivityCarInfo.this)
                    .load(UserData.create(ActivityCarInfo.this).get(UserData.driverOperation))
                    .placeholder(R.mipmap.default_image)
                    .into(ivDriverOperation);
            ivImg4.setImageResource(R.mipmap.icon_address_selected);
        }else {
            ivImg4.setImageResource(R.mipmap.icon_address_unselected);
        }

    }

    @Override
    protected void initData() {

    }


    @Override
    protected int getTitleBarType() {
        return 0;
    }
}
